<template>
	<view>
		<view class="post-container">
			<view class="post-author-date">
				<image class="post-author" :src="newInfo.mediaAvatar"></image>
				<text class="post-date">{{newInfo.newsTime|fnFormatDate}}</text>
			</view>
			<text class="post-title">{{newInfo.newsTitle}}</text>
			<image class="post-image" :src="newInfo.newsImgSrc[0]"></image>
			<text class="post-content">{{newInfo.newsContent}}</text>
			<view class="post-like">
				<image class="post-like-image" src="/static/images/icon/chat.png"></image>
				<text class="post-like-font">{{newInfo.newsCollection}}</text>
				<image class="post-like-image" src="/static/images/icon/view.png"></image>
				<text class="post-like-font">{{newInfo.newsReading}}</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {

			};
		},
		props: {
			newInfo: {
				type: Object,
				default: {}
			}
		}
	}
</script>

<style lang="scss">
	.post-container {
		display: flex;
		flex-direction: column;
		margin-top: 20rpx;
		margin-bottom: 40rpx;
		background-color: #fff;
		border-top: 1px solid #ededed;
		border-bottom: 1px solid #ededed;
		padding-bottom: 10rpx;
		/*内边距*/
	}

	.post-author-date {
		margin: 10rpx 0rpx 20rxp 10rpx;
		display: flex;
		/*垂直居中*/
		flex-direction: row;
		align-items: center;
	}

	.post-author {
		height: 60rpx;
		width: 60rpx;
		/* vertical-align: middle;  垂直居中 */
	}

	.post-date {
		margin-left: 20rpx;
		/* vertical-align: middle; */
		font-size: 26rpx;
	}

	.post-title {
		font-size: 34rpx;
		font-weight: 600;
		margin-bottom: 10px;
		margin-left: 10px;
		color: #333;
	}

	.post-image {
		width: 100%;
		height: 340rpx;
		margin-bottom: 15px;
	}

	.post-content {
		font-size: 28rpx;
		color: #666;
		letter-spacing: 2rpx;
		/*文字之间的间距*/
		margin-left: 20rpx;
		margin-bottom: 20rpx;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
	}

	.post-like {
		display: flex;
		flex-direction: row;
		align-items: center;
		font-size: 26rpx;
		margin-left: 20rpx;
	}

	.post-like-image {
		height: 32rpx;
		width: 32rpx;
		margin-right: 16rpx;
		/*文字图片距离*/
	}

	.post-like-font {
		margin-right: 40rpx;
	}
</style>
